<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <!-- Meta -->
    <meta name="description" content="Premium Quality and Responsive UI for Dashboard."/>
    <meta name="author" content="ThemePixels"/>

    <link rel="shortcut icon" th:href="@{/picture/favicon.ico}" type="image/x-icon"/>
    <title>茅台·天津 | 会员管理系统</title>

    <!-- vendor css -->
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/css/ionicons.css}" rel="stylesheet"/>
    <link th:href="@{/css/perfect-scrollbar.css}" rel="stylesheet"/>
    <link th:href="@{/css/github.css}" rel="stylesheet"/>
    <link th:href="@{/css/jquery.datatables.css}" rel="stylesheet"/>
    <link th:href="@{/css/select2.min.css}" rel="stylesheet"/>


    <!-- Starlight CSS -->
    <link rel="stylesheet" th:href="@{/css/starlight.css}"/>
</head>

<body>

<!-- ########## START: LEFT PANEL ########## -->
<div class="sl-logo"><a href=""><img th:src="@{/picture/mt_logo_wh.jpg}" style="width: 30px; height: 30px;"/> <span
        style="font-size: 18px">会员管理系统</span></a></div>
<div class="sl-sideleft">

    <label class="sidebar-label">导航栏</label>
    <div class="sl-sideleft-menu">
        <a href="#" class="sl-menu-link active show-sub">
            <div class="sl-menu-item">
                <i class="menu-item-icon icon ion-ios-paper-outline tx-20"></i>
                <span class="menu-item-label">客户管理</span>
                <i class="menu-item-arrow fa fa-angle-down"></i>
            </div><!-- menu-item -->
        </a><!-- sl-menu-link -->
        <ul class="sl-menu-sub nav flex-column">
            <li class="nav-item"><a th:href="@{/customer/list}" class="nav-link">客户列表</a></li>
            <li class="nav-item"><a th:href="@{/customer/addCustomer}" class="nav-link">新增客户</a></li>
            <li class="nav-item"><a th:href="@{/company/list}" class="nav-link">企业列表</a></li>
            <li class="nav-item"><a th:href="@{/customer/cusLevelList}" class="nav-link active">客户等级列表</a></li>
        </ul>

        <a th:href="@{/about}" class="sl-menu-link">
            <div class="sl-menu-item">
                <i class="menu-item-icon icon ion-ios-bookmarks-outline tx-20"></i>
                <span class="menu-item-label">关于</span>
            </div><!-- menu-item -->
        </a><!-- sl-menu-link -->
    </div><!-- sl-sideleft-menu -->

</div><!-- sl-sideleft -->
<!-- ########## END: LEFT PANEL ########## -->

<!-- ########## START: HEAD PANEL ########## -->
<div class="sl-header">
    <div class="sl-header-left">
        <div class="navicon-left hidden-md-down"><a id="btnLeftMenu" href=""><i class="icon ion-navicon-round"></i></a>
        </div>
        <div class="navicon-left hidden-lg-up"><a id="btnLeftMenuMobile" href=""><i class="icon ion-navicon-round"></i></a>
        </div>
    </div><!-- sl-header-left -->
    <div class="sl-header-right">
        <nav class="nav">
            <div class="dropdown">
                <a href="" class="nav-link nav-link-profile" data-toggle="dropdown">
                    <span class="logged-name" th:text="${user.companyShortName} + ' | ' + ${user.name}">海津皇冠 | 皇冠</span>
                    <img th:src="@{/picture/moutai.png}" class="wd-32 rounded-circle" alt=""/>
                </a>
                <div class="dropdown-menu dropdown-menu-header wd-200">
                    <ul class="list-unstyled user-profile-nav">
                        <li><a href=""><i class="icon ion-ios-person-outline"></i> Edit Profile</a></li>
                        <li><a href=""><i class="icon ion-ios-gear-outline"></i> Settings</a></li>
                        <li><a href=""><i class="icon ion-ios-download-outline"></i> Downloads</a></li>
                        <li><a href=""><i class="icon ion-ios-star-outline"></i> Favorites</a></li>
                        <li><a href=""><i class="icon ion-ios-folder-outline"></i> Collections</a></li>
                        <li><a th:href="@{/logout}"><i class="icon ion-power"></i> Sign Out</a></li>
                    </ul>
                </div><!-- dropdown-menu -->
            </div><!-- dropdown -->
        </nav>
        <div class="navicon-right">
            <a id="btnRightMenu" href="" class="pos-relative">
                <i class="icon ion-ios-bell-outline"></i>
                <!-- start: if statement -->
                <span class="square-8 bg-danger"></span>
                <!-- end: if statement -->
            </a>
        </div><!-- navicon-right -->
    </div><!-- sl-header-right -->
</div><!-- sl-header -->
<!-- ########## END: HEAD PANEL ########## -->

<!-- ########## START: RIGHT PANEL ########## -->

<!-- ########## END: RIGHT PANEL ########## -->

<!-- ########## START: MAIN PANEL ########## -->
<div class="sl-mainpanel">
    <nav class="breadcrumb sl-breadcrumb">
        <!--<a class="breadcrumb-item" th:href="@{/activity/list}">茅台销售登记系统</a>-->
        <a class="breadcrumb-item" href="#">客户管理</a>
        <span class="breadcrumb-item active">客户等级管理</span>
    </nav>

    <div class="sl-pagebody">

        <div class="card pd-20 pd-sm-40">
            <h6 class="card-body-title">客户等级管理</h6>
            <p class="mg-b-20 mg-sm-b-10">Customer level management.</p>

            <div class="row tx-center mg-b-10">
                <div class="col-sm-3 col-lg-2">
                    <button type="button" class="btn btn-outline-primary btn-block" data-toggle="modal" data-target="#myModal">
                        添加级别
                    </button>
                </div><!-- col-3 -->
                <div class="col-sm-3 col-lg-1 mg-t-30 mg-sm-t-0">
                    <button type="button" class="btn btn-outline-primary btn-block">
                        导入
                    </button>
                </div><!-- col-3 -->
                <div class="col-sm-3 col-lg-1 mg-t-30 mg-sm-t-0">
                    <button type="button" class="btn btn-outline-primary btn-block">
                        导出
                    </button>
                </div><!-- col-3 -->
            </div><!-- row -->

            <div class="table-responsive">
                <!-- table start-->
                <table id="datatable1" class="table display responsive nowrap">
                    <thead>
                    <tr>
                        <th class="wd-25p" style="text-align: center">客户级别名称</th>
                        <th class="wd-25p" style="text-align: center">区间最小积分</th>
                        <th class="wd-25p" style="text-align: center">区间最大积分</th>
                        <th class="wd-25p" style="text-align: center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="cusLevel : ${list}">
                        <td th:text="${cusLevel.name}" style="text-align: center">Tiger</td>
                        <td th:text="${cusLevel.minScore}" style="text-align: center">Nixon</td>
                        <td th:text="${cusLevel.maxScore}" style="text-align: center">2011/04/25</td>
                        <td style="text-align: center">
                            <input type="hidden" class="cusLevelId" th:value="${cusLevel.id}"/>
                            <a href="#" class="bt_update mg-r-10" data-toggle="modal" data-target="#updateModal">编辑</a>
                            <a href="#" class="bt_del" data-toggle="modal" data-target="#confirmModal">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div><!-- table-responsive -->

            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
                 aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content" id="modalContent"></div>
                    <div class="card pd-20 pd-sm-40 form-layout form-layout-4">
                        <h6 class="card-body-title">添加用户等级</h6>
                        <p class="mg-b-10 mg-sm-b-15">Add customer level.</p>
                        <p style="color: red;display:inline-block;width:298px;text-align:center;" id="msg"></p>
                        <div class="row">
                            <label class="col-sm-4 form-control-label">级别名称: <span class="tx-danger">*</span></label>
                            <div class="col-sm-8 mg-t-10 mg-sm-t-0">
                                <input type="text" class="form-control" name="name" placeholder="请输入客户级别名称"/>
                            </div>
                        </div><!-- row -->
                        <div class="row mg-t-20">
                            <label class="col-sm-4 form-control-label">最小积分数: <span class="tx-danger">*</span></label>
                            <div class="col-sm-8 mg-t-10 mg-sm-t-0">
                                <input type="text" class="form-control" name="minScore" placeholder="请输入区间最小积分数"/>
                            </div>
                        </div>
                        <div class="row mg-t-20">
                            <label class="col-sm-4 form-control-label">最大积分数: <span class="tx-danger">*</span></label>
                            <div class="col-sm-8 mg-t-10 mg-sm-t-0">
                                <input type="text" class="form-control" name="maxScore" placeholder="请输入区间最大积分数"/>
                            </div>
                        </div>
                        <div class="form-layout-footer mg-t-30">
                            <button class="btn btn-info mg-r-5" id="bt_insertCusLevel">添  加</button>
                            <button class="btn btn-secondary" data-dismiss="modal">取  消</button>
                        </div><!-- form-layout-footer -->
                    </div>
                </div>
            </div>

            <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
                 aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content" id="modalContent2"></div>
                    <div class="card pd-20 pd-sm-40 form-layout form-layout-4">
                        <h6 class="card-body-title">修改用户等级</h6>
                        <p class="mg-b-10 mg-sm-b-15">Update customer level.</p>
                        <p style="color: red;display:inline-block;width:298px;text-align:center;" id="msg_update"></p>
                        <div class="row">
                            <label class="col-sm-4 form-control-label">级别名称: <span class="tx-danger">*</span></label>
                            <div class="col-sm-8 mg-t-10 mg-sm-t-0">
                                <input type="hidden" id="update-id"/>
                                <input type="text" class="form-control" id="update-name" placeholder="请输入客户级别名称"/>
                            </div>
                        </div><!-- row -->
                        <div class="row mg-t-20">
                            <label class="col-sm-4 form-control-label">最小积分数: <span class="tx-danger">*</span></label>
                            <div class="col-sm-8 mg-t-10 mg-sm-t-0">
                                <input type="text" class="form-control" id="update-minScore" placeholder="请输入区间最小积分数"/>
                            </div>
                        </div>
                        <div class="row mg-t-20">
                            <label class="col-sm-4 form-control-label">最大积分数: <span class="tx-danger">*</span></label>
                            <div class="col-sm-8 mg-t-10 mg-sm-t-0">
                                <input type="text" class="form-control" id="update-maxScore" placeholder="请输入区间最大积分数"/>
                            </div>
                        </div>
                        <div class="form-layout-footer mg-t-30">
                            <button class="btn btn-info mg-r-5" id="bt_updateCusLevel">修  改</button>
                            <button class="btn btn-secondary" data-dismiss="modal">取  消</button>
                        </div><!-- form-layout-footer -->
                    </div>
                </div>
            </div>

            <div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content" id="modalContent1">
                        <div class="modal-header">
                        <h5 class="modal-title tx-14 mg-b-0 tx-uppercase tx-inverse tx-bold" id="modalLabel">删除信息</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        </div>
                        <div class="modal-body">
                            <span class="mg-r-30">确定要删除该条记录？</span><br/>
                            <span style="color: red;display:inline-block;width:200px;text-align:center;" id="msg_del"></span>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-info pd-x-20" id="bt_confirm">确  定</button>
                            <button type="button" class="btn btn-secondary pd-x-20" data-dismiss="modal">取  消</button>
                        </div>
                    </div>
                </div>
            </div>

        </div><!-- card -->

    </div><!-- sl-pagebody -->
    <footer class="sl-footer">
        <div class="footer-left">
            <div class="mg-b-2">Copyright &copy; 2018. 天津海津皇冠贸易有限公司. All Rights Reserved.</div>
        </div>
        <div class="footer-right d-flex align-items-center">Made by 海津皇冠.</div>
    </footer>
</div><!-- sl-mainpanel -->
<!-- ########## END: MAIN PANEL ########## -->


<script th:src="@{/js/jquery.js}"></script>
<script th:src="@{/js/popper.js}"></script>
<script th:src="@{/js/bootstrap.js}"></script>
<script th:src="@{/js/perfect-scrollbar.jquery.js}"></script>
<script th:src="@{/js/highlight.pack.js}"></script>
<script th:src="@{/js/jquery.datatables.js}"></script>
<script th:src="@{/js/datatables.responsive.js}"></script>
<script th:src="@{/js/select2.min.js}"></script>

<script th:src="@{/js/starlight.js}"></script>
<script th:src="@{/custom/customer-level.js}"></script>
<script type="text/javascript">

    // <![CDATA[
    $(function () {
        'use strict';

        $('#datatable1').DataTable({
            responsive: true,
            language: {
                searchPlaceholder: '搜索...',
                sSearch: '',
                lengthMenu: '_MENU_ 条/页',
            }
        });

        // Select2
        $('.dataTables_length select').select2({minimumResultsForSearch: Infinity});
    });

    // ]]>
</script>

</body>
</html>
